<?php
namespace App\Model;

class UserAddress extends Model
{
    // 表名
    protected $table = 'user_address';
    
    // 保护属性
    protected $guarded = [];
    
    // 格式
    protected $casts = [
        'data' => 'array'
    ];
    
    protected $dateFormat = 'U';
    
    // 用户
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}